home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11s.lha / HBBS / Source / Doors_System / XPR / GUI / XPR_GuiMain.c < prev    next >
C/C++ Source or Header  |  1996-06-25  |  786b  |  43 lines

  1. /* Compile me to get full executable. */
  2.  
  3. #include <stdio.h>
  4. #include "XPR_Gui.c"
  5.  
  6.  
  7. int main(void)
  8. {
  9. int done=0;
  10. ULONG class;
  11. UWORD code;
  12. struct Gadget *pgsel;
  13. struct IntuiMessage *imsg;
  14. OpenDiskFonts();
  15. if (OpenWindowXPRWin()==0)
  16.     {
  17.     while(done==0)
  18.         {
  19.         Wait(1L << XPRWin->UserPort->mp_SigBit);
  20.         imsg=GT_GetIMsg(XPRWin->UserPort);
  21.         while (imsg != NULL )
  22.             {
  23.             class=imsg->Class;
  24.             code=imsg->Code;
  25.             pgsel=(struct Gadget *)imsg->IAddress; /* Only reference if it is a gadget message */
  26.             GT_ReplyIMsg(imsg);
  27.             if (class==IDCMP_CLOSEWINDOW)
  28.                 done=1;
  29.             if (class==IDCMP_REFRESHWINDOW)
  30.                 {
  31.                 GT_BeginRefresh(XPRWin);
  32.                 GT_EndRefresh(XPRWin, TRUE);
  33.                 }
  34.             imsg=GT_GetIMsg(XPRWin->UserPort);
  35.             }
  36.         }
  37.     
  38.     CloseWindowXPRWin();
  39.     }
  40. else
  41.     printf("Cannot open window.\n");
  42. }
  43.